<template>
  <van-cell :to="'/article/' + article.art_id" class="article-cell" :title="article.title">
  <!-- <van-cell :to="`/article/${article.art_id}`" class="article-cell" :title="article.title"> -->
  <!-- <van-cell :to="{
    name: 'article',
    params: {
      articleId: article.art_id
    }
  }" class="article-cell" :title="article.title"> -->
    <!-- 自定义标题下方的内容 -->
    <!-- 自定义标题下方的内容 -->
    <div slot="label" class="article-label">
      <div class="image-box" v-if="article.cover.type === 3">
        <van-image
          v-for="(item, i) in article.cover.images"
          :key="i"
          class="label-image"
          fit="contain"
          :src="item"
        />
      </div>
      <span>{{ article.aut_name }}</span>
      <span class="common-num">评论 {{ article.comm_count }}</span>
      <span>{{ article.pubdate | relativeTime }}</span>
    </div>

    <!-- 自定义右侧内容插槽default -->
    <van-image
      v-if="article.cover.type === 1"
      class="right-image"
      fit="contain"
      :src="article.cover.images[0]"
    />
  </van-cell>
</template>

<script>
export default {
  data() {
    return {

    }
  },

  props: {
    // list数组每一项的数据 item
    article: {
      type: Object,
      required: true
    }
  },

  created() {

  },

  methods: {

  }
}
</script>

<style scoped lang='less'>
.article-cell {
  .article-label {
    .common-num {
      margin: 0px 20px;
    }

    .image-box {
      display: flex;
      margin: 15px 0;
      .label-image {
        width: 232px;
        height: 146px;
      }
    }
  }

  .right-image {
    width: 232px;
    height: 146px;
  }
}
</style>
